package com.iwords.service.ao.impl;

import java.util.Collections;
import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.iwords.service.WordFreDetailService;
import com.iwords.service.WordFreDetailServiceLocal;
import com.iwords.service.object.WordFrequencyDetailEntity;
import com.iwords.service.persistence.WordFreDetailPersistence;

@Stateless
public class WordFreDetailServiceImpl implements WordFreDetailService, WordFreDetailServiceLocal {

	private static final Log log = LogFactory.getLog(WordFreDetailServiceImpl.class);
	@EJB
	WordFreDetailPersistence wordFreDetailPersistence;

	@SuppressWarnings("unchecked")
	public List<WordFrequencyDetailEntity> getWordFreDetailByWordId(Long wordid) {
		try {
			return wordFreDetailPersistence.getWordFreDetailByWordId(wordid.toString());
		} catch (Exception e) {
			log.error("查询单词频率出错", e);
		}
		return Collections.EMPTY_LIST;
	}

	@SuppressWarnings("unchecked")
	public List<WordFrequencyDetailEntity> getWordFreDetailListByIds(List<String> ids) {

		try {
			return wordFreDetailPersistence.getWordFreDetailListByIds(ids);
		} catch (Exception e) {
			log.error("查询单词频率出错", e);
		}
		return Collections.EMPTY_LIST;
	}

}
